#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os.path
path = R'G:\高级课程.txt\d\c'

# 切分文件路径和文件名
Split = os.path.split(path)
Split1 = os.path.split(path)[0]
print(Split,Split1)


# 切分结果为空字符串
NONE = os.path.split('')
print(NONE)

# 以最后一个斜线为分隔符
test = os.path.split('C:\\windows')
print(test)

test2 = os.path.split('C:\\windows\\')
print(test2)

# 切分驱动器符号
Drive = os.path.splitdrive(path)
print(Drive)